﻿
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>
<% var uid = Guid.NewGuid(); %>
<%: Html.TextBox(
        string.Empty,
        Model.HasValue ? Model.Value.ToString("yyyy-MM-dd") : string.Empty,
        new { @id = uid, @class="form-control" }
    )
%>
<script type="text/javascript">
    $("#<%: uid %>").datepicker({ format: 'yy-mm-dd' });
</script>